/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bean;

import java.util.Collection;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import models.ProductType;
import models.Products;
import services.Impl.ProductsServiceImpl;

/**
 *
 * @author SERGA
 */
@ManagedBean(name="productBean")
@SessionScoped
public class ProductBean {
    public ProductBean() {
    }
    
    @EJB
    private ProductsServiceImpl productService;
    private String name;
    private String description;
    private double price;
    private ProductType prType;
    
    @EJB
    private Products curentProduct;
    
    public Products getCurentProduct() {
        return curentProduct;
    }

    public void setCurentProduct(Products curentProduct){
        this.curentProduct = curentProduct;
    }
    
    public String getProductName() {
        return name;
    }
    
    public void setProductName(String name) {
        this.name = name;
    }
    
    public String getProductDescription() {
        return description;
    }
    
    public void setProductDescription(String description) {
        this.description = description;
    }
    
    public double getProductPrice() {
        return price;
    }
    
    public void setProductPrice(double price) {
        this.price = price;
    }
    
    public ProductType getProductType() {
        return prType;
    }
    
    public void setProductType(ProductType prType) {
        this.prType = prType;
    }
    
    public Collection<Products> getAllProducts() {
        return productService.findAll();
    }
}
